package DVD;

/**
 * @(#)DVD.java
 *
 * DVD application
 *
 * @author
 * @version 1.00 2012/5/7
 */

public class DVD {

            private String title;
            private String category;
            private boolean newRelease;
            private boolean availableForRent;

            public DVD ()
                {
                }
                public DVD (String t,int cat,boolean newR,boolean avlForRent)
                {
                     setTitle(t);
                     setCategory(cat);
                     setRelease(newR);
                     setAvailable(avlForRent);
                }

            public void setTitle(String aTitle)
            {
                title = aTitle;
            }
            public void setCategory(int aCategory)
            {
                switch(aCategory)
               {
            case 1:
                category = "horror";
                break;
            case 2:
                category = "Sci-fi";
                break;
            case 3:
                category = "Drama";
                break;
            case 4:
                category = "Romance";
                break;
            case 5:
                category = "Comedy";
                break;
            case 6:
                category = "Action";
                break;
            case 7:
                category = "Cartoon";
                break;
            }

            }
            public void setRelease(boolean rel)
            {
                newRelease =rel;
            }
            public void setAvailable(boolean avail)
            {
                availableForRent = avail;
            }
            public String getTitle()
            {
                return title;
            }
            public String getCategory()
            {
                return category;
            }
            public boolean isNewRelease()
            {
                    return newRelease;
            }
            public boolean isAvailable()
            {
                return availableForRent;
            }
            public String toString()
            {
                String msg = String.format("%s %d %b %b",getTitle(),getCategory(),isNewRelease(),isAvailable());
                return msg;
            }
}
